package com.latvia.managers;

import java.util.ArrayList;

import com.latvia.cookingapp.CookingApp;
import com.latvia.model.Recipe;
import com.latvia.utils.Constants;
import com.latvia.utils.JsonQueryAsyncTask;

public class WebserviceManager implements JsonQueryAsyncTask.OnTaskCompletedListener {
	
	
	
	private static WebserviceManager instance;
	private JsonQueryAsyncTask task;
	private int parseMode;
	
	public static WebserviceManager getInstance() {
		if (instance == null) {
			instance = new WebserviceManager();
		}
		return instance;
	}
	
	
	public void executeGetAllRecipes() {
		String query = String.format("%s/%s%s", Constants.BASE_URL, Constants.RECIPES, Constants.JSON); 
		
		task = new JsonQueryAsyncTask(CookingApp.getAppContext(), query, Constants.recipes);
		task.setOnTaskCompletedListener(this);
		task.execute();
	}


	@Override
	public void onQueryTaskCompleted(ArrayList<Recipe> result) {
		
		
	}

	
	
}
